import { computed } from 'vue';
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';

export const columns = (t: (key: string) => string) => {
  return computed<TableColumnData[]>(() => [
    {
      title: t('searchTable.columns.index'),
      dataIndex: 'id',
      slotName: 'id',
      align: 'center',
    },
    {
      title: t('searchTable.columns.name_role'),
      dataIndex: 'name',
      slotName: 'name',
      align: 'center',
    },
    {
      title: t('searchTable.columns.sort'),
      dataIndex: 'sort',
      slotName: 'sort',
      align: 'center',
    },
    {
      title: t('searchTable.columns.code'),
      dataIndex: 'code',
      slotName: 'code',
      align: 'center',
    },
    {
      title: t('searchTable.columns.remark'),
      dataIndex: 'remark',
      slotName: 'remark',
      align: 'center',
    },
    {
      title: t('searchTable.columns.state'),
      dataIndex: 'state',
      slotName: 'state',
      align: 'center',
    },

    {
      title: t('searchTable.columns.operations'),
      dataIndex: 'operations',
      slotName: 'operations',
      align: 'center',
      fixed: 'right',
      width: 180,
    },
  ]);
};
